﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace SimplePad.Plugins
{
	public class Plugin<ClientInterface>
	{
		public Plugin()
		{
		}

		public Plugin(string filename, PluginType pluginType, ClientInterface instance)
		{
			_PluginType = pluginType;
			_Instance = instance;
			_Filename = filename;
		}

		#region PluginType
		private PluginType _PluginType = PluginType.Unknown;

		public PluginType PluginType
		{
			get { return (_PluginType); }
			set { _PluginType = value; }
		}
		#endregion

		#region Filename
		private string _Filename = string.Empty;

		public string Filename
		{
			get { return (_Filename); }
			set { _Filename = value; }
		}
		#endregion

		#region Language
		private SourceFileLanguage _Language = SourceFileLanguage.Unknown;

		public SourceFileLanguage Language
		{
			get { return (_Language); }
			set { _Language = value; }
		}
		#endregion

		#region Instance
		private ClientInterface _Instance = default(ClientInterface);

		public ClientInterface Instance
		{
			get { return (_Instance); }
			set { _Instance = value; }
		}
		#endregion

		#region InstanceAssembly
		private Assembly _InstanceAssembly = default(Assembly);

		public Assembly InstanceAssembly
		{
			get { return (_InstanceAssembly); }
			set { _InstanceAssembly = value; }
		}
		#endregion

		public Type GetType(string name)
		{
			return (_InstanceAssembly.GetType(name, false, true));
		}

	}
}
